﻿using Furion.DependencyInjection;

namespace Admin.NET.Core.Btms;

/// <summary>
/// 单号生成器
/// </summary>
public class BillNoManager : ISingleton
{
    private readonly ISqlSugarClient _db;
    private readonly IServiceScope _serviceScope;

    public BillNoManager(IServiceScopeFactory scopeFactory)
    {
        _serviceScope = scopeFactory.CreateScope();
        _db = _serviceScope.ServiceProvider.GetRequiredService<ISqlSugarClient>();
    }

    /// <summary>
    /// 根据entityName获取单号，并且返回json格式的数组
    /// </summary>
    public string CreateBillNo(string entityName)
    {
        // TODO 根据entityName获取单号
        return YitIdHelper.NextId() + ""; //暂时模拟
    }
}
